import { request } from "@/utils/service"
import type * as banks from "./types/banks"
import type * as amountRanges from "./types/amountRanges"
import type * as holidays from "./types/holidays"
import type * as rates from "./types/rates"
import type * as bankTypeDict from "./types/bankTypeDict"
import type * as rateDateRanges from "./types/rateDateRanges"

// #region 银行 Banks
/**
 * 银行 Banks
 */
/**
 * 获取银行列表数据的API函数
 * @param params - 银行列表请求参数，包含分页、筛选等条件
 * @returns 返回API请求结果，数据类型为any
 */
export function getBanksIndexApi(params: banks.GetTableRequestData) {
  return request<banks.GetTableResponseData>({
    url: "/Banks/index", // API请求地址
    method: "get",
    params // 请求参数
  })
}
export function getBanksReadApi(params: any) {
  return request<any>({
    url: "/Banks/read",
    method: "get",
    params
  })
}

export function getBankssearchApi(params: banks.GetSearchRequestData) {
  return request<any>({
    url: "/Banks/search",
    method: "get",
    params
  })
}
export function createBankApi(data: any) {
  return request<any>({
    url: "/Banks/create",
    method: "post",
    data
  })
}
export function updateBankApi(data: any) {
  return request<any>({
    url: "/Banks/update",
    method: "post",
    data
  })
}
export function deleteBankApi(data: any) {
  return request<any>({
    url: "/Banks/delete",
    method: "post",
    data
  })
}
// #endregion

// #region 银行类型字典 BankTypeDict
/**
 * 银行类型字典 BankTypeDict
 */
export function getBankTypeDictIndexApi(params: any) {
  return request<any>({
    url: "/BankTypeDict/index",
    method: "get",
    params
  })
}
export function getBankTypeDictSearchApi(params: any) {
  return request<any>({
    url: "/BankTypeDict/search",
    method: "get",
    params
  })
}
export function getBankTypeDictAllListApi(params: bankTypeDict.GetAllListRequestData) {
  return request<any>({
    url: "/BankTypeDict/allList",
    method: "get",
    params
  })
}
export function createBankTypeDictApi(data: bankTypeDict.CreateRequestData) {
  return request<any>({
    url: "/BankTypeDict/create",
    method: "post",
    data
  })
}
export function deleteBankTypeDictApi(data: bankTypeDict.DeleteRequestData) {
  return request<any>({
    url: "/BankTypeDict/delete",
    method: "post",
    data
  })
}
// #endregion

// #region 金额区间 AmountRanges
/**
 * 金额区间 AmountRanges
 */
export function getAmountRangesIndexApi(params: amountRanges.GetTableRequestData) {
  return request<any>({
    url: "/AmountRanges/index",
    method: "get",
    params
  })
}
export function getAmountRangesAllListApi(params: amountRanges.GetAllListRequestData) {
  return request<any>({
    url: "/AmountRanges/allList",
    method: "get",
    params
  })
}
export function getAmountRangesReadApi(params: any) {
  return request<any>({
    url: "/AmountRanges/read",
    method: "get",
    params
  })
}
export function getAmountRangesSearchApi(params: amountRanges.GetSearchRequestData) {
  return request<any>({
    url: "/AmountRanges/search",
    method: "get",
    params
  })
}
export function createAmountRangeApi(data: amountRanges.CreateRequestData) {
  return request<any>({
    url: "/AmountRanges/create",
    method: "post",
    data
  })
}
export function updateAmountRangeApi(data: any) {
  return request<any>({
    url: "/AmountRanges/update",
    method: "post",
    data
  })
}
export function deleteAmountRangeApi(data: amountRanges.DeleteRequestData) {
  return request<any>({
    url: "/AmountRanges/delete",
    method: "post",
    data
  })
}
/**
 * 根据ID数组获取金额区间数据
 */
export function getAmountRangesByIdsApi(data: any) {
  return request<any>({
    url: "/AmountRanges/getByIds",
    method: "post",
    data
  })
}
// #endregion

// #region 节假日 Holidays
/**
 * 节假日 Holidays
 */
export function getHolidaysIndexApi(params: holidays.GetTableRequestData) {
  return request<any>({
    url: "/Holidays/index",
    method: "get",
    params
  })
}
export function getHolidaysReadApi(params: any) {
  return request<any>({
    url: "/Holidays/read",
    method: "get",
    params
  })
}
export function createHolidayApi(data: any) {
  return request<any>({
    url: "/Holidays/create",
    method: "post",
    data
  })
}
export function updateHolidayApi(data: any) {
  return request<any>({
    url: "/Holidays/update",
    method: "post",
    data
  })
}
export function deleteHolidayApi(data: any) {
  return request<any>({
    url: "/Holidays/delete",
    method: "post",
    data
  })
}
// #endregion

// #region 到期日期区间 RateDateRanges
/**
 * 到期日期区间 RateDateRanges
 */
export function getRateDateRangesIndexApi(params: any) {
  return request<any>({
    url: "/RateDateRanges/index",
    method: "get",
    params
  })
}
export function getRateDateRangesAllListApi(params: rateDateRanges.GetAllListRequestData) {
  return request<any>({
    url: "/RateDateRanges/allList",
    method: "get",
    params
  })
}
export function getRateDateRangesReadApi(params: any) {
  return request<any>({
    url: "/RateDateRanges/read",
    method: "get",
    params
  })
}
export function createRateDateRangeApi(data: rateDateRanges.CreateRequestData) {
  return request<any>({
    url: "/RateDateRanges/create",
    method: "post",
    data
  })
}
export function updateRateDateRangeApi(data: any) {
  return request<any>({
    url: "/RateDateRanges/update",
    method: "post",
    data
  })
}
export function deleteRateDateRangeApi(data: rateDateRanges.DeleteRequestData) {
  return request<any>({
    url: "/RateDateRanges/delete",
    method: "post",
    data
  })
}
/**
 * 根据ID数组获取到期日期区间数据
 */
export function getRateDateRangesByIdsApi(data: any) {
  return request<any>({
    url: "/RateDateRanges/getByIds",
    method: "post",
    data
  })
}
// #endregion

// #region  利率 Rates
/**
 * 利率 Rates
 */
export function getRatesIndexApi(params: rates.GetTableRequestData) {
  return request<any>({
    url: "/Rates/index",
    method: "get",
    params
  })
}
export function getRatesAllListApi(params: any) {
  return request<any>({
    url: "/Rates/allList",
    method: "get",
    params
  })
}
export function getRatesReadApi(params: rates.GetReadRequestData) {
  return request<any>({
    url: "/Rates/read",
    method: "get",
    params
  })
}

export function createRateApi(data: rates.CreateRequestData) {
  return request<any>({
    url: "/Rates/create",
    method: "post",
    data
  })
}
export function updateRateApi(data: rates.UpdateRequestData) {
  return request<any>({
    url: "/Rates/update",
    method: "post",
    data
  })
}
export function deleteRateApi(data: any) {
  return request<any>({
    url: "/Rates/delete",
    method: "post",
    data
  })
}
/**
 * 利率计算
 */
export function calcRatesApi(data: any) {
  return request<any>({
    url: "/Rates/calc",
    method: "post",
    data
  })
}
/**
 * 根据ID数组获取利率数据
 */
export function getRatesByIdsApi(data: any) {
  return request<any>({
    url: "/Rates/getByIds",
    method: "post",
    data
  })
}
// #endregion

// #region 加价规则 ScoreRule
/**
 * 加价规则 ScoreRule
 */
export function getScoreRuleIndexApi(params: any) {
  return request<any>({
    url: "/ScoreRule/index",
    method: "get",
    params
  })
}
export function getScoreRuleReadApi(params: any) {
  return request<any>({
    url: "/ScoreRule/read",
    method: "get",
    params
  })
}
export function createScoreRuleApi(data: any) {
  return request<any>({
    url: "/ScoreRule/create",
    method: "post",
    data
  })
}
export function updateScoreRuleApi(data: any) {
  return request<any>({
    url: "/ScoreRule/update",
    method: "post",
    data
  })
}
export function deleteScoreRuleApi(data: any) {
  return request<any>({
    url: "/ScoreRule/delete",
    method: "post",
    data
  })
}
// #endregion
